package com.qingyunge.util;

public class MyfenPriceUtil {
    public static String getSalaryRange(Double salary) {
        switch (getRangeIndex(salary)) {
            case 0:
                return "0-2k";
            case 1:
                return "2k-4k";
            case 2:
                return "4k-6k";
            case 3:
                return "6k-8k";
            case 4:
                return "8k-10k";
            case 5:
                return "10k-12k";
            case 6:
                return ">12k";
            default:
                return "Invalid salary";
        }
    }

    public static int getRangeIndex(Double salary) {
        if (salary >= 0 && salary < 2000) {
            return 0;
        } else if (salary >= 2000 && salary < 4000) {
            return 1;
        } else if (salary >= 4000 && salary < 6000) {
            return 2;
        } else if (salary >= 6000 && salary < 8000) {
            return 3;
        } else if (salary >= 8000 && salary < 10000) {
            return 4;
        } else if (salary >= 10000 && salary < 12000) {
            return 5;
        } else if (salary >= 12000) {
            return 6;
        } else {
            return -1; // Invalid salary
        }
    }
    public static String getQuarter(int month) {
        if (month >= 1 && month <= 3) {
            return "春季";
        } else if (month >= 4 && month <= 6) {
            return "夏季";
        } else if (month >= 7 && month <= 9) {
            return "秋季";
        } else if (month >= 10 && month <= 12) {
            return "冬季";
        } else {
            return "未知";
        }
    }
}
